package com.yuandian.bpm.bi.modules.email.controller;

import com.yuandian.bpm.bi.modules.email.entity.EmailInfo;
import com.yuandian.bpm.bi.modules.email.service.EmailService;
import com.yuandian.bpm.common.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author lipeiguang
 * @description: 邮件测试类
 * @date 2020/10/2 15:31
 **/
@RestController
@RequestMapping("email")
public class MailController {
	@Autowired
	private EmailService emailService;
	@PostMapping("send")
	public R<String> sendMsg(@RequestBody EmailInfo emailInfo){



		return emailService.sendEmail(emailInfo);
	}

	/**
	 * 发送测试邮件接口
	 * @param address
	 * @return
	 */
	@GetMapping("sendTest")
	public R<String> sendTest(String address, Integer senderId){

		return emailService.sendTestmail(address, senderId);
	}



}
